home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / basic / vbhelp.exe / HELPUTIL.FRM < prev   
Text File  |  1993-02-09  |  7KB  |  255 lines

  1. Version 1.00
  2. BEGIN Form frmHelpUtils
  3.     AutoRedraw   = 0
  4.     BackColor    = QBColor(7)
  5.     BorderStyle  = 1
  6.     Caption      = "Search"
  7.     ControlBox   = -1
  8.     Enabled      = -1
  9.     ForeColor    = QBColor(0)
  10.     Height       = Char(18)
  11.     Left         = Char(14)
  12.     MaxButton    = 0
  13.     MinButton    = 0
  14.     MousePointer = 0
  15.     Tag          = ""
  16.     Top          = Char(3)
  17.     Visible      = -1
  18.     Width        = Char(55)
  19.     WindowState  = 0
  20.     BEGIN TextBox txtCopyArea
  21.         BackColor    = QBColor(7)
  22.         BorderStyle  = 1
  23.         DragMode     = 0
  24.         Enabled      = -1
  25.         ForeColor    = QBColor(0)
  26.         Height       = Char(14)
  27.         Left         = Char(1)
  28.         MousePointer = 0
  29.         MultiLine    = -1
  30.         ScrollBars   = 3
  31.         TabIndex     = 0
  32.         TabStop      = -1
  33.         Tag          = ""
  34.         Text         = ""
  35.         Top          = Char(2)
  36.         Visible      = 0
  37.         Width        = Char(45)
  38.     END
  39.     BEGIN CommandButton cmdOK
  40.         BackColor    = QBColor(7)
  41.         Cancel       = 0
  42.         Caption      = "OK"
  43.         Default      = -1
  44.         DragMode     = 0
  45.         Enabled      = -1
  46.         Height       = Char(3)
  47.         Left         = Char(40)
  48.         MousePointer = 0
  49.         TabIndex     = 3
  50.         TabStop      = -1
  51.         Tag          = ""
  52.         Top          = Char(2)
  53.         Visible      = -1
  54.         Width        = Char(12)
  55.     END
  56.     BEGIN CommandButton cmdCancel
  57.         BackColor    = QBColor(7)
  58.         Cancel       = -1
  59.         Caption      = "Cancel"
  60.         Default      = 0
  61.         DragMode     = 0
  62.         Enabled      = -1
  63.         Height       = Char(3)
  64.         Left         = Char(40)
  65.         MousePointer = 0
  66.         TabIndex     = 4
  67.         TabStop      = -1
  68.         Tag          = ""
  69.         Top          = Char(5)
  70.         Visible      = -1
  71.         Width        = Char(12)
  72.     END
  73.     BEGIN Label lblSelectText
  74.         Alignment    = 0
  75.         AutoSize     = 0
  76.         BackColor    = QBColor(7)
  77.         BorderStyle  = 0
  78.         Caption      = "Select text to copy to the Clipboard:"
  79.         DragMode     = 0
  80.         Enabled      = -1
  81.         ForeColor    = QBColor(0)
  82.         Height       = Char(1)
  83.         Left         = Char(1)
  84.         MousePointer = 0
  85.         TabIndex     = 5
  86.         Tag          = ""
  87.         Top          = Char(1)
  88.         Visible      = 0
  89.         Width        = Char(38)
  90.     END
  91.     BEGIN ListBox lstSearch
  92.         BackColor    = QBColor(7)
  93.         DragMode     = 0
  94.         Enabled      = -1
  95.         ForeColor    = QBColor(0)
  96.         Height       = Char(14)
  97.         Left         = Char(1)
  98.         MousePointer = 0
  99.         Sorted       = -1
  100.         TabIndex     = 1
  101.         TabStop      = -1
  102.         Tag          = ""
  103.         Top          = Char(2)
  104.         Visible      = -1
  105.         Width        = Char(37)
  106.     END
  107.     BEGIN ListBox lstHistory
  108.         BackColor    = QBColor(7)
  109.         DragMode     = 0
  110.         Enabled      = -1
  111.         ForeColor    = QBColor(0)
  112.         Height       = Char(14)
  113.         Left         = Char(1)
  114.         MousePointer = 0
  115.         Sorted       = 0
  116.         TabIndex     = 2
  117.         TabStop      = -1
  118.         Tag          = ""
  119.         Top          = Char(2)
  120.         Visible      = 0
  121.         Width        = Char(37)
  122.     END
  123.     BEGIN Label lblSelectTopic
  124.         Alignment    = 0
  125.         AutoSize     = 0
  126.         BackColor    = QBColor(7)
  127.         BorderStyle  = 0
  128.         Caption      = "Select topic to display:"
  129.         DragMode     = 0
  130.         Enabled      = -1
  131.         ForeColor    = QBColor(0)
  132.         Height       = Char(1)
  133.         Left         = Char(1)
  134.         MousePointer = 0
  135.         TabIndex     = 6
  136.         Tag          = ""
  137.         Top          = Char(1)
  138.         Visible      = -1
  139.         Width        = Char(26)
  140.     END
  141. END
  142. ' ------------------------------------------------------------------------
  143. ' Visual Basic for MS-DOS Help Toolkit
  144. '
  145. ' Form for Search, History, and Change dialogs.
  146. '
  147. ' The Help Toolkit (HELP.BAS, HELPF.FRM, and HELPUTIL.FRM)
  148. ' makes it easy to add a hypertext Help system to your
  149. ' applications.
  150. '
  151. ' To use the Help Toolkit in your programs, include
  152. ' HELP.BAS, HELPF.FRM, and HELPUTIL.FRM in your program or
  153. ' use the supplied library (HELP.LIB, HELPA.LIB - AltMath
  154. ' version) and Quick library (HELP.QLB) and call the
  155. ' appropriate routines to load and display your help topics.
  156. ' Forms and code modules that call Help routines
  157. ' must include HELP.BI ('$INCLUDE: 'HELP.BI').
  158. '
  159. ' Refer to the module level comments in HELP.BAS for
  160. ' more information on using the Help Toolkit.
  161. '
  162. ' Copyright (C) 1982-1992 Microsoft Corporation
  163. '
  164. ' You have a royalty-free right to use, modify, reproduce
  165. ' and distribute the sample applications and toolkits provided with
  166. ' Visual Basic for MS-DOS (and/or any modified version)
  167. ' in any way you find useful, provided that you agree that
  168. ' Microsoft has no warranty, obligations or liability for
  169. ' any of the sample applications or toolkits.
  170. ' ------------------------------------------------------------------------
  171.  
  172. ' Include file containing procedure declarations.
  173. '$INCLUDE: 'HELP.BI'
  174.  
  175. ' Variables common to HELP.BAS, HELPF.FRM, and HELPUTIL.FRM.
  176. COMMON SHARED /HelpLib/ DialogBackcolor AS INTEGER ' Background color for Help dialog boxes (Search, Copy, History)
  177. COMMON SHARED /HelpLib/ DialogForecolor AS INTEGER ' Foreground color for Help dialog boxes (Search, Copy, History)
  178.  
  179. CONST FALSE = 0
  180. CONST TRUE = NOT FALSE
  181.  
  182. ' Click event for Cancel command button.
  183. ' Hides the form and sets the form's tag property to null.
  184. '
  185. SUB cmdCancel_Click ()
  186.     tag = ""
  187.     HIDE
  188. END SUB
  189.  
  190. ' Click event procedure for the OK command button.
  191. ' Changes the form's tag property to
  192. ' a value depending on the type of dialog
  193. ' being used (e.g. Search, History, or Copy).
  194. '
  195. SUB cmdOK_Click ()
  196.     SELECT CASE Caption
  197.         CASE "Search"
  198.             tag = lstSearch.Text
  199.         CASE "History"
  200.             tag = lstHistory.Text
  201.         CASE "Copy"
  202.             ' Check if any text is selected.  If not,
  203.             ' assume the person wants to copy it all.
  204.             IF txtCopyArea.SelLength = 0 THEN
  205.                 txtCopyArea.SelStart = 0
  206.                 txtCopyArea.SelLength = LEN(txtCopyArea.Text)
  207.             END IF
  208.             clipboard.SETTEXT txtCopyArea.SelText
  209.     END SELECT
  210.     HIDE
  211. END SUB
  212.  
  213. ' Load event procedure for the form.
  214. ' Centers the dialog.
  215. '
  216. SUB Form_Load ()
  217.     Left = (screen.Width - Width) \ 2
  218.     Top = (screen.Height - Height) \ 2
  219.  
  220.     ' Set all control and form colors using the
  221.     ' colors set with HelpSetOptions.
  222.     Backcolor = DialogBackcolor
  223.     txtCopyArea.Backcolor = DialogBackcolor
  224.     Backcolor = DialogBackcolor
  225.     cmdOK.Backcolor = DialogBackcolor
  226.     cmdCancel.Backcolor = DialogBackcolor
  227.     lblSelectText.Backcolor = DialogBackcolor
  228.     lstSearch.Backcolor = DialogBackcolor
  229.     lstHistory.Backcolor = DialogBackcolor
  230.     lblSelectTopic.Backcolor = DialogBackcolor
  231.  
  232.     Forecolor = DialogForecolor
  233.     txtCopyArea.Forecolor = DialogForecolor
  234.     lblSelectText.Forecolor = DialogForecolor
  235.     lstSearch.Forecolor = DialogForecolor
  236.     lstHistory.Forecolor = DialogForecolor
  237.     lblSelectTopic.Forecolor = DialogForecolor
  238.  
  239. END SUB
  240.  
  241. ' Double Click event procedure for the History listbox.
  242. ' Invokes click event procedure for the OK command button.
  243. '
  244. SUB lstHistory_dblClick ()
  245.     CALL cmdOK_Click
  246. END SUB
  247.  
  248. ' Double Click event procedure for the Search listbox.
  249. ' Invokes click event procedure for the OK command button.
  250. '
  251. SUB lstSearch_dblClick ()
  252.     CALL cmdOK_Click
  253. END SUB
  254.  
  255.